using System;
using Com.SimonProctor.Html;

namespace HtmlParserTests
{
    /// <summary>
    /// 
    /// </summary>
    public abstract class TestBase
    {
        protected Parser parser;

        protected String text;

        protected int startTagCount;

        protected int endTagCount;

        protected int textCount;

        protected int declarationCount;

        protected int commentCount;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void parser_Declaration(object sender, DeclarationEventArgs e)
        {
            System.Console.Error.WriteLine("Declaration " + e.HtmlEvent.Text);
            declarationCount++;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void parser_Comment(object sender, CommentEventArgs e)
        {
            System.Console.Error.WriteLine("Comment " + e.HtmlEvent.Text);
            commentCount++;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void parser_EndTag(object sender, EndTagEventArgs e)
        {
            System.Console.Error.WriteLine("End tag " + e.HtmlEvent.Text);
            endTagCount++;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void parser_StartTag(object sender, StartTagEventArgs e)
        {
            System.Console.Error.WriteLine("Start tag " + e.HtmlEvent.Text);
            startTagCount++;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void parser_Text(object sender, TextEventArgs e)
        {
            System.Console.Error.WriteLine("text '" + e.HtmlEvent.Text + "'");
            textCount++;
        }
    }
}
